Devices capable of executing program code, such as IoT devices, servers, desktop computers, laptop computers, mobile telephones, tablets etc., are capable of recording the state of the device at the moment in time when an event, for example an error, occurs. However, errors are often caused by long sequences of unusual actions. In order to fix the program code and prevent future occurrences of the error a developer must work backwards from the record of the state of the device when the error occurred to find the root cause of the error. This is a difficult process, which is sometimes only possible by reproducing the error conditions many times in a laboratory.